package com.xhwl.logistics.service.impl.redis;

import com.xhwl.logistics.util.AboutDateUtil;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.scheduling.annotation.Async;

import javax.annotation.Resource;
import java.util.Date;

//@Service
public class VehicleExceptionRedisServiceImpl {

    @Resource(name = "stringRedisTemplate")
    ValueOperations<String, String> valueOperations;

    @Async("threadPoolTaskExecutorForLog")
    public void exceptionMessage(String key, String value) {
        String vehicleExceptionPrefix = "cent-logistics:exception:";
        valueOperations.set(vehicleExceptionPrefix + key + ":" + AboutDateUtil.dateToString(new Date(), "yyyy-MM-dd'T'HHmmss.SSS"), value);
    }

}
